﻿Imports System.Text
Imports Microsoft.WindowsAPICodePack.Taskbar
Imports System.Text.RegularExpressions

Public Class CalisiyorConverter
    Implements IValueConverter
    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        If value Then
            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate)
            Return "Red"
        Else
            TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.NoProgress)
            Return "White"
        End If
    End Function
    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        If value.ToString = "Red" Then
            Return True
        Else
            Return False
        End If
    End Function
End Class

Public Class TextConverter
    Implements IValueConverter
    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        'If Not String.IsNullOrEmpty(value.ToString) Then
        'Dim fd As New FlowDocument()

        'Dim text As String() = (DirectCast(value, String)).Split(" ")

        'Dim p As New Paragraph()
        'Dim sb As New StringBuilder()

        ''add text and pictures, etc. and return now InlineCollection instead of FlowDocument

        'Return p.Inlines
        'Else
        'Return New FlowDocument()
        'End If
        Dim icol As New List(Of Inline)
        icol.Add(New Bold(New Run("Deneme")))

        Return icol
        'Return value
    End Function
    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Return value
    End Function
End Class
